home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1994-03-07 | 2.2 KB | 91 lines |
- >TemplateSz get template sizes
- " at line ";
- getfile
- print
- getfile
- '"Enter file name or * command:"'file$
- file$,1)="*"
- file$
- F%=0
- file$
- F%=0
- "File "file$" not found"
- F%<>0
- #F%:a%+=(
- #F%)<<8:a%+=(
- #F%)<<16:a%+=(
- #F%)<<24
- print
- "Print (Y/N)? ";
- "YyNn",a$)
- a%<3:
- U%=-1
- !,largest_def% = 0 : total_indirected% = 0
- 0,1)" File: ";file$" with ";M%+1" windows"'
- " name #ic #iic i-space b-space iic offst iic offst iic offst iic offst"
- I%=0
- %) L%=12-
- name$(I%):name$(I%)+=
- L%," ")
- &* @%=3:
- name$(I%),nicon%(I%),nind%(I%);
- @%=7:
- indi%(I%),size%(I%);
- (# total_indirected% += indi%(I%)
- size%(I%) > largest_def%
- largest_def% = size%(I%)
- nind%(I%)>0
- @%=5
- J%=1
- nind%(I%)
- -' U%+=1:
- indn%(U%),inds%(U%)-ind%;
- .)
- J%<nind%(I%)
- 35," ");
- '"Largest template definition = "+
- largest_def%+" (&"+
- ~(largest_def%)+")"
- "Total indirected buffer space = "+
- total_indirected%+" (&"+
- ~(total_indirected%)+")"
- "Buffer size for Wimp_LoadTemplate = "+
- (largest_def% + total_indirected%)+" (&"+
- ~(largest_def% + total_indirected%)+")"
- name$(100),nicon%(100),indi%(100),size%(100),nind%(100)
- inds%(500),indn%(500)
- name% 12,blk% &5000,ind% &2000
- #F%=16
- M%=-1:O%=
- M%+=1:size%(M%)=
- #F%+16
- #F%:F%=0
- "Wimp_OpenTemplate",,file$
- N%=0:M%=-1:U%=-1
- $name%="*"
- "Wimp_LoadTemplate",,blk%,ind%,ind%+&2000,-1,name%,N%
- ,,R%,,,,N%
- N%>0
- M%+=1
- name$(M%)=$name%
- indi%(M%)=R%-ind%
- nicon%(M%)=blk%!84
- V%=0
- indi%(M%)>0
- PE
- (&100
- blk%!56)>0 V%+=1:U%+=1:inds%(U%)=blk%!72:indn%(U%)=-1
- blk%!84>0
- I%=blk%+88
- (blk%!84)-1
- TC
- (&100
- I%!16)>0 V%+=1:U%+=1:inds%(U%)=I%!20:indn%(U%)=J%
- I%+=32
- V
- nind%(M%)=V%
- N%=0
- "Wimp_CloseTemplate"
- F%<>0
- #F%:F%=0
-